package com.maiji.cloud.mapper;

import com.maiji.cloud.entities.community.ComMsgInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2019-06-19
 */
@Mapper
public interface ComMsgInfoMapper extends BaseMapper<ComMsgInfo>{

    public List<ComMsgInfo> integralList(@Param("userId")String userId,@Param("publishTime")Long publishTime,@Param("page")Integer page,@Param("size")Integer size);

    /**
     * 置顶列表
     * @return
     */
    public List<ComMsgInfo> topList(@Param("userId")String userId);

    /**
     * 案例列表
     * @param userId
     * @param publishTime
     * @param page
     * @param size
     * @return
     */
    public List<ComMsgInfo> caseList(@Param("userId")String userId,@Param("publishTime")Long publishTime,@Param("page")Integer page,@Param("size")Integer size);

    /**
     * 推荐列表
     * @param userId 用户ID 用户判断是否关注 是否收藏 是否点赞等
     * @param publishTime 动态时间
     * @param page
     * @param size
     * @return
     */
    public List<ComMsgInfo> recommends(@Param("userId")String userId,@Param("publishTime")Long publishTime,@Param("page")Integer page,@Param("size")Integer size,@Param("priority")Integer  priority,@Param("isCurPri")Boolean isCurPri,@Param("actName")String actName);


    /**
     * 数量
     * @param userId
     * @param publishTime
     * @param priority
     * @param isCurPri
     * @param actName
     * @return
     */
    public Integer normalCount(@Param("userId")String userId,@Param("publishTime")Long publishTime,@Param("priority")Integer  priority,@Param("isCurPri")Boolean isCurPri,@Param("actName")String actName);


    /**
     * 关注动态列表
     * @param userId 用户ID 用户判断是否关注 是否收藏 是否点赞等
     * @param publishTime
     * @param page
     * @param size
     * @return
     */
    public List<ComMsgInfo> focuserBlogList(@Param("userId")String userId,@Param("publishTime")Long publishTime,@Param("page")Integer page,@Param("size")Integer size);


    /**
     * 动态详细
     * @param msgId
     * @return
     */
    public ComMsgInfo detail(@Param("msgId")String msgId,@Param("userId")String userId);

    /**
     * 通过msgids 查询 动态列表
     * @param msgIds
     * @param userId 用户ID 用户判断是否关注 是否收藏 是否点赞等
     * @return
     */
    public List<ComMsgInfo> findListByMsgIds(@Param("msgIds")List<String> msgIds, @Param("userId")String userId);


    /**
     * 根据 actName 查询动态列表
     * @param userId
     * @param publishTime
     * @param page
     * @param size
     * @param priority
     * @param isCurPri
     * @param actName
     * @return
     */
    public List<ComMsgInfo> findMsgsByActName(@Param("userId")String userId,@Param("publishTime")Long publishTime,@Param("page")Integer page,@Param("size")Integer size,@Param("priority")Integer  priority,@Param("isCurPri")Boolean isCurPri,@Param("actName")String actName);

    /**
     * 通过个人查询动态列表
     * @param publisherId 发送动态的ID
     * @param userId 用户ID 用户判断是否关注 是否收藏 是否点赞等
     * @return
     */
    public List<ComMsgInfo> findListByPublisherId(@Param("publisherId")String publisherId,@Param("userId")String userId,@Param("priority")Integer  priority,@Param("page")Integer page,@Param("size")Integer size);

    /**
     * 根据用户ID查询动态数量
     * @param userId
     * @return
     */
    public Integer dynamicSumCountCount(@Param("userId")String userId); 
    
}


